class Solution:
    def missingNumber(self, nums):
        nums.sort()
        for idx, value in enumerate(nums):
            if (idx != value):
                return idx
        return len(nums)
